﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Program.cs" company="Matthias Friedrich">
//   Copyright © Matthias Friedrich 2013
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace UnitySample
{
    using System;
    using System.Linq;

    using CommandlineHandling;

    using Microsoft.Practices.Unity;

    internal class Program
    {
        private static void Main(string[] args)
        {
            var container = new UnityContainer();
            container.RegisterType<ICommandLineOption, SampleOption>("x");

            var handler = new CommandLineHandler();
            handler.ResolveOption += (x) => container.Resolve<ICommandLineOption>(x);

            ICommandLineOption arg = handler.Parse(args).FindByName("x").First();
            arg.InvokeExecute();

            Console.ReadKey();
        }
    }
}